package com.example.demo.niuke;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;

/**
 * @Author: liull
 * @Description: 判断短字符串中的所有字符是否在长字符串中全部出现
 * c1 : 短字符串
 * c2 : 长字符串
 * 使用HashSet，c2构成的set包含每一个c1的字符则返回true
 * @Date: Created in 13:10 2020/4/1
 * @Modified By:
 */
public class Main43 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line;
        //        System.out.println(Arrays.toString("127.0.0.1".split("\\.")));
        while ((line = br.readLine()) != null) {
            String r = br.readLine();
            System.out.println(isContainAllChar(line, r));
        }

    }

    private static boolean isContainAllChar(String c1, String c2) {
        Set<String> set = new HashSet<>();
        String[] array = c2.split("");
        String[] array2 = c1.split("");
        for (String s : array) {
            set.add(s);
        }
        for (String s : array2) {
            if (!set.contains(s)) {
                return false;
            }
        }
        return true;
    }
}